package com.sykj.qianxuezhan.server.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sykj.qianxuezhan.bean.Shop;
import com.sykj.qianxuezhan.bean.ShopPost;
import com.sykj.qianxuezhan.bean.ShopUser;
import com.sykj.qianxuezhan.mapper.ShopMapper;
import com.sykj.qianxuezhan.server.ShopService;
import com.sykj.util.reponse.CommonEnum;
import com.sykj.util.reponse.ResultBody;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author QianXuezhan
 * @Date 2020/7/19 15:25
 * @Description: TODO
 */
@Service
public class ShopServiceImpl  extends ServiceImpl<ShopMapper, Shop> implements ShopService {
    @Autowired
    private  ShopMapper shopMapper;
    @Override
    public List<Shop> queryShop() {
        return shopMapper.queryShop();
    }

    @Override
    public ResultBody updateShop(Shop shop) {
        shopMapper.updateShop(shop);
        return new ResultBody(CommonEnum.SUCCESS);
    }

    @Override
    public ResultBody saveShop(Shop shop) {
        shopMapper.saveShop(shop);
        return new ResultBody(CommonEnum.SUCCESS);
    }

    @Override
    public ShopUser queryShopUserAcc(String account) {
        return shopMapper.queryShopUserAcc(account);
    }

}
